<template>
  <div class="coment">
    <div class="boxs">
      <h1>提交评论</h1>
      <span>返回</span>
    </div>
    <hr />
    <br />
    <textarea class="textarea" placeholder="请输入回复评论"></textarea>
    <div class="anning">
      <van-button type="info" class="juzhong" @click="zhongle()"
        >发表</van-button
      >
    </div>
    <hr />
    <div class="boxs">
      <h1>评论列表</h1>
      <span>44评论</span>
    </div>

    <hr />
    <div class="anni" v-for="item in list" :key="item.id">
      <p>{{ item.content }}</p>
      <br />
      <span class="lanse">{{ item.user_name }} </span>
      &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      <span>{{ item.add_time }}</span>
    </div>

    <van-button type="info" class="jiazai">加载更多</van-button>
  </div>
</template>

<script>
import { getcomments, postcomment } from "@/apis/category";
export default {
  data() {
    return {
      id: this.$route.params.id,
      list: [],
    };
  },
  async created() {
    const res = await getcomments(this.id);
    console.log(res, "res");
    this.list = res.data.message;
    console.log(this.list);
  },
  methods: {
    zhongle() {},
  },
};
</script>

<style lang="less" scoped>
.coment {
  height: 600px;
  .boxs {
    display: flex;
    justify-content: space-around;

    h1 {
      font-size: 20px;
    }
    span {
      font-size: 15px;
      color: #68b0ff;
    }
  }
  .anning {
    text-align: center;
    .juzhong {
      width: 330px;
    }
  }
  .textarea {
    width: 96.77778vw;
    height: 80px;
    //   background-color: #d7d7d7;
    border-radius: 5px;
    flex: 1;
    padding: 5px;
  }
  .jusshang {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
  }
  .anni {
    border: 1px solid #eaeaec;
    height: 50px;
    margin-top: 5px;
    .lanse {
      color: #58b6ff;
    }
  }
}
</style>